package wqh.pojo;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by TsinghuaWoo on 2017/1/3.
 */
public class JStree {

    private Long id;

    private String text;

    private String icon;

    private Integer level;

    private List<JStree> children;

    public JStree(Long id, String text, Integer level){
        this.id = id;
        this.text = text;
        this.level = level;
        this.icon = "glyphicon glyphicon-flag";
        if(level == 1)  this.icon = "glyphicon glyphicon-globe";
        if(level == 2)  this.icon = "glyphicon glyphicon-home";
        if(level == 3)  this.icon = "glyphicon glyphicon-flag";
        this.children = new ArrayList<JStree>();
    }

    public JStree(Long id, String text, Integer level, List<JStree> jStrees){
        this.id = id;
        this.text = text;
        this.level = level;
        this.icon = "glyphicon glyphicon-flag";
        if(level == 1)  this.icon = "glyphicon glyphicon-globe";
        if(level == 2)  this.icon = "glyphicon glyphicon-home";
        if(level == 3)  this.icon = "glyphicon glyphicon-flag";
        this.children = jStrees;
    }

    @Override
    public String toString() {
        return "JStree{" +
                "id=" + id +
                ", text='" + text + '\'' +
                ", icon='" + icon + '\'' +
                ", level=" + level +
                ", children=" + children +
                '}';
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public List<JStree> getChildren() {
        return children;
    }

    public void setChildren(List<JStree> children) {
        this.children = children;
    }
}
